# @Time    :2025/3/31 15:32
"""
1)多态应用在方法参数位置
"""


class Animals:
    def go(self):#为子类提供一个统一的接口，子类可以重新这个方法
        pass


class Dog(Animals):
    def go(self):
        print("跑")


class Fish(Animals):
    def go(self):
        print("水里游泳。")


class Bird(Animals):
    def go(self):
        print("飞")


def go(animals):  # 定义一个go函数，接收一个参数
    animals.go()


dog = Dog()
fish = Fish()
bird = Bird()

go(dog)
go(fish)
go(bird)
